package com.labichaoka.chaoka.ui.home.adapter;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.labichaoka.chaoka.R;
import com.labichaoka.chaoka.entity.HomeInitResponse;

import java.util.List;


/**
 * Created by ruan on 2018/7/26.
 */

public class ZixunAdapter extends BaseQuickAdapter<HomeInitResponse.DataBean.NewsBean,BaseViewHolder> {
    private Context mContext;

    public ZixunAdapter(List<HomeInitResponse.DataBean.NewsBean> data, Context context) {
        super(R.layout.item_zixun,data);
        this.mContext=context;
    }


    @Override
    protected void convert(BaseViewHolder helper, HomeInitResponse.DataBean.NewsBean item) {
        helper.setText(R.id.title,item.getTitle());
        helper.setText(R.id.time,item.getNowDate());
        ImageView logoview = helper.getView(R.id.img);
        Glide.with(mContext).load(item.getAppPicUrl()).into(logoview);
    }

    @Override
    public void onViewRecycled(BaseViewHolder holder) {
        super.onViewRecycled(holder);
    }
}



